package cn.lili.modules.share.mapper;

import cn.lili.modules.share.entity.docs.AppUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-03-21
 */
public interface AppUserMapper extends BaseMapper<AppUser> {

    /**
     * 推广+1
     * @param parentOpenid
     * @return
     */
    @Update("UPDATE app_user SET tuiguang=tuiguang + 1 WHERE openid=#{parentOpenid}")
    int updateAppUserTuiguangByOpenId(String parentOpenid);


    /**
     * 更新购买参数为已完成
     *
     * @param openid
     * @return
     */
    @Update("UPDATE app_user SET is_true = 1 WHERE openid = #{openid}")
    int updateAppUserIsTureByOpenId(String openid);
}
